
/*
clang  -nostdlib -c -target riscv32 -march=rv32i -O3 test02.c
llvm-objcopy -O binary test02.o test.bin

GCC
riscv32-esp-elf-gcc -march=rv32i -O2 -c test02.c
llvm-objdump -d test02.o
llvm-objcopy -O binary test02.o test02.bin
lua -e"WIDTH=32;DEPTH=512;" bin2mi.lua test02.bin

*/


int loop(){
    *(volatile int*)0x3c = 0x123;
    int max = *(int*)0x100;
    int i = 0;
    int ret = 0;
    for(i=0;i<max;i++){
        ret += i;
    }
    return ret;
}
